package com.wgts.wgts.dagger.module;

import com.wgts.wgts.dagger.scope.FragmentScope;
import com.wgts.wgts.mvp.model.IOperatingDataFragmentModel;
import com.wgts.wgts.mvp.model.imp.OperatingDataFragmentModel;
import com.wgts.wgts.mvp.presenter.IOperatingDataFragmentPresenter;
import com.wgts.wgts.mvp.presenter.imp.OperatingDataFragmentPresenter;
import com.wgts.wgts.mvp.view.IOperatingDataFragmentView;
import com.wgts.wgts.netmodle.NetService;

import dagger.Module;
import dagger.Provides;

@Module
public class OperatingDataFragmentModule {

    private IOperatingDataFragmentView view;

    public OperatingDataFragmentModule(IOperatingDataFragmentView view) {
        this.view = view;
    }

    @Provides
    @FragmentScope
    public IOperatingDataFragmentView provideView(){
        return view;
    }

    @Provides
    @FragmentScope
    public IOperatingDataFragmentModel provideModel(NetService netService){
        return new OperatingDataFragmentModel(netService);
    }

    @Provides
    @FragmentScope
    public IOperatingDataFragmentPresenter providePresenter(IOperatingDataFragmentView view, IOperatingDataFragmentModel model){
        return new OperatingDataFragmentPresenter(model, view);
    }
}
